<include file="Public:header" />
<script type="text/javascript" src="__PUBLIC__/js/kindeditor-all-min.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/zh_CN.js"></script>
<link rel="stylesheet" href="__PUBLIC__/css/kindeditor.css" type="text/css" />
<if condition="$log['category_id'] neq 1 && C('ismobile') neq 1">
<script type="text/javascript">
	var editor;
	KindEditor.ready(function(K) {
		editor = K.create('textarea[name="content"]', {
			uploadJson:'{:U("file/editor")}',
			allowFileManager : true,
			loadStyleMode : false,
			fileManagerJson: "{:U('file/manager')}"
		});
	});	
</script>
</if>
<div class="container">
	<!-- Docs nav ================================================== -->
	<div class="page-header">
		<h4>{:L('EDIT_LOG')}</h4>
	</div>	
	<div class="row">
		<div class="span12">
			<include file="Public:alert" />
			<form action="{:U('log/mylog_edit')}" method="post">
				<input type="hidden" name="log_id" value="{$log.log_id}"/>
				<table class="table" width="95%" border="0" cellspacing="1" cellpadding="0">
					<thead>
						<tr>
							<td>&nbsp;</td>
							<td><input name="submit" class="btn btn-primary" type="submit" value="{:L('SAVE')}"/> &nbsp; <input class="btn" onclick="javascript:history.go(-1)" type="reset" value="{:L('RETURN')}"/></td>
						</tr>
					</thead>
					<tfoot>
						<tr> 
							<td>&nbsp;</td>
							<td><input name="submit" class="btn btn-primary" type="submit" value="{:L('SAVE')}"/> &nbsp; <input class="btn" type="reset" onclick="javascript:history.go(-1)" value="{:L('RETURN')}"/></td>					
						</tr>
					</tfoot>
					<tbody width="100%">
						<tr>
							<th colspan="2">{:L('BASIC_INFO')}</th>
						</tr>
						<if condition="$_GET['type'] eq 1">
							<tr>
								<if condition="!empty($log['customer_id'])">
									<td class="tdleft">{:L('BELONG_TO_CUSTOMER')}</td>
									<td><a href="{:U('customer/view','id='.$log['customer_id'])}" target="blank">{$log.customer_name}</a></td>					
								<elseif condition="!empty($log['contacts_id'])" />
									<td class="tdleft">{:L('BELONG_TO_CONTACTS')}</td>
									<td><a href="{:U('contacts/view','id='.$log['contacts_id'])}" target="blank">{$log.contacts_name}</a></td>
								<elseif condition="!empty($log['business_id'])" />
									<td class="tdleft">{:L('BELONG_TO_BUSINESS')}</td>
									<td><a href="{:U('business/view','id='.$log['business_id'])}" target="blank">{$log.business_name}</a></td>
								<elseif condition="!empty($log['task_id'])" />
									<td class="tdleft">{:L('BELONG_TO_TASK')}</td>
									<td><a href="{:U('task/view','id='.$log['task_id'])}" target="blank">{$log.task_name}</a></td>
								<elseif condition="!empty($log['event_id'])" />
									<td class="tdleft">{:L('BELONG_TO_EVENT')}</td>
									<td><a href="{:U('event/view','id='.$log['event_id'])}" target="blank">{$log.event_name}</a></td>
								<elseif condition="!empty($log['leads_id'])" />
									<td class="tdleft">{:L('BELONG_TO_LEADS')}</td>
									<td><a href="{:U('leads/view','id='.$log['leads_id'])}" target="blank">{$log.leads_name}</a></td>
								</if>
							</tr>
						</if>
						<tr>
							<td class="tdleft">{:L('SUBJECT')}</td>
							<td><input type="text" class="span5" name="subject" maxlength="20" value="{$log.subject}"/></td>						
						</tr>
						<tr>
							<td class="tdleft">{:L('CONTENT')}</td>
							<td width="85%" colspan="3" >
								<textarea rows="15" <if condition="C('ismobile') eq 1">class="span6"<else/>class="span8"</if> name="content" style="height: 350px;">{$log.content}</textarea> 
							</td>							
						</tr>
					</tbody>
				</table>
			</form>
		</div>
	</div>
</div>
<include file="Public:footer" />